A filter is used in video compression technique usually to improve picture quality as well as compression ratio. Blocky artifacts usually occur at decoded pictures of a low bit rate video compression due to quantization noise as well as motion compensation. One of the tasks of a filter is to smoothen the boundaries of blocks in the decoded pictures so that these blocky artifacts are reduced or removed.
Some video compression techniques, for example like the committee draft of ISO/IEC 14496-2 Part 10 which is under development, use loop filter to improve the compression of moving pictures (See Joint Video Team (JVT) of ISO/IEC MPEG and ITU-T VCEG Joint Committee Draft 2002-05-10, JVT-C167 9.5 Deblocking Filter, as an example). Loop filter is applied to both reference and non-reference pictures to improve the picture quality of the decoded pictures.
FIG. 1 shows the decision algorithm used in the committee draft of ISO/IEC 14496-2 Part 10 to select the strength of the filter to be used.
The decision is performed at the block boundary of two neighboring blocks p and q. First, a determination is performed on the blocks p and q to determine one of them is intra-coded or not (Step S102). If one of the blocks p and q is intra-coded (Yes in Step S102), a check is performed to see if the block boundary falls on a macroblock boundary (Step S103). If the result of the check shows that the block boundary falls on the macroblock boundary, that is, if the two blocks are not from the same macroblock, the strongest strength (Bs=4) will be selected (Yes in Step S103). If the result of the check shows that the block boundary does not fall on the macroblock boundary, that is, if these two blocks are from the same macroblock, the second strongest strength (Bs=3) will be selected (No in Step S103).
If the result of the check (Step S102) shows that both the blocks p and q are not intra-coded (No in Step S102), a check is then performed to see if any of the two blocks contain coefficients indicating spatial frequency components resulted from orthogonal transform (Step S104). If one of these two blocks contains coefficients (Yes in Step S104), the third strongest strength (Bs=2) will be selected. If neither of the two blocks contains coefficients, that is, if coefficients are not coded in both blocks p and q (No in Step S104), a decision will be made as follows to see if filtering is to be skipped or not (Step S105).
The reference picture index numbers for both blocks p and q, Ref(p) and Ref(q), will be checked to see if they are the same. Furthermore, vertical components (V(p,y) and (V(q,y)) and horizontal components (V(p,x) and (V(q,x)) of the motion vectors of the two blocks will also be compared with one another to see if there is a difference of less than one pixel. Only when the results of the above two checks show that the two blocks' reference picture index numbers are the same and their vertical and horizontal motion vectors are less than one pixel apart (No in Step S105), filtering of the boundary between these two blocks shall be skipped. In all other cases (Yes in Step S105), a weak filtering (Bs=1) shall be performed on the block boundary.
However, the decision algorithm in the prior art does not sufficiently cover all possible cases for blocks in a predictive-coded picture referring to two pictures. The reason is because macroblocks in a predictive-coded picture referring to two pictures can be predicted using direct, forward, backward modes, and a mode in which two pictures are referred to. These prediction modes have not been considered in the decision algorithm of the prior art. Similarly, in the case where one block uses direct mode and the other block uses a mode in which two pictures are referred to, motion vectors to be used for comparison have not been sufficiently described in the prior art.